home *** CD-ROM | disk | FTP | other *** search
- package org.spruce.midp.draw;
-
- import java.io.IOException;
- import javax.microedition.lcdui.Canvas;
- import javax.microedition.lcdui.Graphics;
- import javax.microedition.lcdui.Image;
- import javax.microedition.rms.RecordStore;
- import javax.microedition.rms.RecordStoreException;
-
- // $FF: renamed from: org.spruce.midp.draw.b
- class class_0 extends Canvas implements Runnable {
- // $FF: renamed from: a java.lang.String
- private static final String field_0 = "I\bb6\u0001\u007f<b\"\u0015";
- // $FF: renamed from: b javax.microedition.lcdui.Image
- private Image field_1;
- // $FF: renamed from: c javax.microedition.lcdui.Image
- private Image field_2;
- // $FF: renamed from: d javax.microedition.lcdui.Image
- private Image field_3;
- // $FF: renamed from: e javax.microedition.lcdui.Image
- private Image field_4;
- // $FF: renamed from: f boolean[][]
- private boolean[][] field_5 = new boolean[((Canvas)this).getWidth()][((Canvas)this).getHeight()];
- // $FF: renamed from: g int
- private int field_6 = ((Canvas)this).getWidth() / 2;
- // $FF: renamed from: h int
- private int field_7 = ((Canvas)this).getHeight() / 2;
- // $FF: renamed from: i boolean
- private boolean field_8;
- // $FF: renamed from: j boolean
- private boolean field_9;
- // $FF: renamed from: k int
- private int field_10;
- // $FF: renamed from: l int
- private int field_11;
- // $FF: renamed from: m boolean
- private boolean field_12;
- // $FF: renamed from: n int[][]
- private static final int[][] field_13 = new int[][]{{0, 4, 3, 7}, {2, 0, 5, 6}, {1, 2, 1, 2}, {3, 6, 2, 3}, {3, 9, 1, 1}, {5, 6, 1, 1}};
- // $FF: renamed from: o int[][]
- private static final int[][] field_14 = new int[][]{{2, 0, 3, 7}, {0, 2, 7, 3}, {1, 1, 5, 5}};
- // $FF: renamed from: p int[][]
- private static final int[][] field_15 = new int[][]{{0, 1, 6, 7}, {1, 0, 6, 7}};
- // $FF: renamed from: q boolean
- public static boolean field_16;
-
- public class_0() {
- try {
- this.field_2 = Image.createImage(method_6("5\u001be1=j\u001d~ \u000bvV`-\u0005"));
- this.field_3 = Image.createImage(method_6("5\u001be1=\u007f\nq0\u0007hV`-\u0005"));
- this.field_4 = Image.createImage(method_6("5\u001be1={\nb,\u00154\b~$"));
- } catch (IOException var3) {
- System.err.println(var3);
- }
-
- this.field_1 = Image.createImage(((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- this.method_5();
- this.method_3();
- if (((Canvas)this).hasPointerEvents()) {
- this.field_8 = true;
- }
-
- (new Thread(this)).start();
- }
-
- public void paint(Graphics var1) {
- label85: {
- byte var2;
- int var8;
- int var10000;
- label82: {
- label86: {
- label87: {
- var8 = a.a;
- var1.drawImage(this.field_1, 0, 0, 20);
- var2 = 20;
- var10000 = ((Canvas)this).hasPointerEvents();
- if (var8 == 0) {
- if (var10000 != 0) {
- break label85;
- }
-
- var10000 = this.field_8;
- if (var8 != 0) {
- break label87;
- }
- }
-
- if (var10000 != 0) {
- int var3 = this.field_6 - 3;
- int var4 = this.field_7 - 3;
- int var5 = 0;
- if (var8 != 0 || var5 < field_14.length) {
- do {
- int[] var6 = field_14[var5];
- var1.setClip(var3 + var6[0], var4 + var6[1], var6[2], var6[3]);
- var1.drawImage(this.field_4, var3, var4, var2);
- ++var5;
- } while(var5 < field_14.length);
- }
- break label85;
- }
-
- var10000 = this.field_9;
- if (var8 != 0) {
- break label86;
- }
- }
-
- if (var10000 != 0) {
- var10000 = this.field_6;
- break label82;
- }
-
- var10000 = this.field_6;
- }
-
- ++var10000;
- }
-
- int var9;
- label56: {
- var9 = var10000;
- var10000 = this.field_9;
- if (var8 == 0) {
- if (var10000 != 0) {
- var10000 = this.field_7 - 7;
- break label56;
- }
-
- var10000 = this.field_7;
- }
-
- var10000 -= 11;
- }
-
- int var10 = var10000;
- int[][] var11 = this.field_9 ? field_15 : field_13;
- int var12 = 0;
- if (var8 != 0 || var12 < var11.length) {
- do {
- int[] var7 = var11[var12];
- var1.setClip(var9 + var7[0], var10 + var7[1], var7[2], var7[3]);
- var1.drawImage(var8 == 0 ? (this.field_9 ? this.field_3 : this.field_2) : this.field_2, var9, var10, var2);
- ++var12;
- } while(var12 < var11.length);
- }
- }
-
- var1.setClip(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- }
-
- public void keyPressed(int var1) {
- int var2 = a.a;
- class_0 var10000 = this;
- if (var2 == 0) {
- label67: {
- switch (((Canvas)this).getGameAction(var1)) {
- case 2:
- var10000 = this;
- if (var2 == 0) {
- if (this.field_6 > 0) {
- --this.field_6;
- this.method_0(this.field_6, this.field_7);
- }
-
- var10000 = this;
- }
-
- var10000.field_10 = -1;
- if (var2 == 0) {
- break;
- }
- case 5:
- var10000 = this;
- if (var2 == 0) {
- if (this.field_6 < ((Canvas)this).getWidth() - 1) {
- ++this.field_6;
- this.method_0(this.field_6, this.field_7);
- }
-
- var10000 = this;
- }
-
- var10000.field_10 = 1;
- if (var2 == 0) {
- break;
- }
- case 1:
- var10000 = this;
- if (var2 == 0) {
- if (this.field_7 > 0) {
- --this.field_7;
- this.method_0(this.field_6, this.field_7);
- }
-
- var10000 = this;
- }
-
- var10000.field_11 = -1;
- if (var2 == 0) {
- break;
- }
- case 6:
- var10000 = this;
- if (var2 == 0) {
- if (this.field_7 < ((Canvas)this).getHeight() - 1) {
- ++this.field_7;
- this.method_0(this.field_6, this.field_7);
- }
-
- var10000 = this;
- }
-
- var10000.field_11 = 1;
- if (var2 == 0) {
- break;
- }
- case 8:
- var10000 = this;
- if (var2 != 0) {
- break label67;
- }
-
- if (!((Canvas)this).hasPointerEvents()) {
- boolean var10001 = this.field_8;
- if (var2 == 0) {
- var10001 = !var10001;
- }
-
- this.field_8 = var10001;
- }
- case 3:
- case 4:
- case 7:
- }
-
- var10000 = this;
- }
- }
-
- ((Canvas)var10000).repaint();
- }
-
- public void keyRepeated(int var1) {
- if (((Canvas)this).getGameAction(var1) != 8) {
- this.keyPressed(var1);
- }
-
- }
-
- public void keyReleased(int var1) {
- label19: {
- int var2 = a.a;
- class_0 var10000 = this;
- int var10001 = var1;
- if (var2 == 0) {
- switch (((Canvas)this).getGameAction(var1)) {
- case 1:
- case 6:
- break label19;
- case 2:
- case 5:
- var10000 = this;
- var10001 = 0;
- break;
- case 3:
- case 4:
- default:
- return;
- }
- }
-
- var10000.field_10 = var10001;
- if (var2 == 0) {
- return;
- }
- }
-
- this.field_11 = 0;
- }
-
- public void pointerPressed(int var1, int var2) {
- this.field_6 = var1;
- this.field_7 = var2;
- this.field_8 = false;
- this.method_0(var1, var2);
- ((Canvas)this).repaint(var1, var2, 1, 1);
- }
-
- public void pointerDragged(int var1, int var2) {
- this.field_6 = var1;
- this.field_7 = var2;
- this.method_0(var1, var2);
- ((Canvas)this).repaint(var1, var2, 1, 1);
- }
-
- public void pointerReleased(int var1, int var2) {
- this.field_8 = true;
- }
-
- // $FF: renamed from: a (int, int) void
- private void method_0(int var1, int var2) {
- if (!this.field_8) {
- Graphics var3 = this.field_1.getGraphics();
- var3.setColor(this.field_9 ? 16777215 : 0);
- var3.drawLine(var1, var2, var1, var2);
- this.field_5[var1][var2] = !this.field_9;
- }
-
- }
-
- // $FF: renamed from: a (boolean) void
- public void method_1(boolean var1) {
- this.field_9 = var1;
- }
-
- // $FF: renamed from: a () void
- public void method_2() {
- Graphics var1 = this.field_1.getGraphics();
- var1.setColor(16777215);
- var1.fillRect(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- this.field_5 = new boolean[((Canvas)this).getWidth()][((Canvas)this).getHeight()];
- System.gc();
- ((Canvas)this).repaint();
- }
-
- // $FF: renamed from: b () void
- private void method_3() {
- int var5 = a.a;
- Graphics var1 = this.field_1.getGraphics();
- var1.setColor(16777215);
- var1.fillRect(0, 0, ((Canvas)this).getWidth(), ((Canvas)this).getHeight());
- var1.setColor(0);
- int var2 = 0;
- if (var5 != 0 || var2 < this.field_5.length) {
- do {
- boolean[] var3 = this.field_5[var2];
- int var4 = 0;
- if (var5 != 0 || var4 < var3.length) {
- do {
- if (var3[var4]) {
- var1.drawLine(var2, var4, var2, var4);
- }
-
- ++var4;
- } while(var4 < var3.length);
- }
-
- ++var2;
- } while(var2 < this.field_5.length);
-
- }
- }
-
- // $FF: renamed from: c () void
- public void method_4() {
- int var5 = a.a;
-
- try {
- RecordStore var1 = RecordStore.openRecordStore(method_6("I\bb6\u0001\u007f<b\"\u0015"), true);
- byte[] var2 = a.a(this.field_5);
- int var10000 = var1.getNumRecords();
- if (var5 == 0) {
- label55: {
- if (var10000 != 0) {
- var1.setRecord(1, var2, 0, var2.length);
- if (var5 == 0) {
- break label55;
- }
- }
-
- var1.addRecord(var2, 0, var2.length);
- }
- }
-
- var1.closeRecordStore();
- } catch (RecordStoreException var8) {
- System.err.println(var8);
- } finally {
- System.gc();
- }
-
- }
-
- // $FF: renamed from: d () void
- public void method_5() {
- try {
- RecordStore var1 = RecordStore.openRecordStore(method_6("I\bb6\u0001\u007f<b\"\u0015"), false);
- byte[] var2 = var1.getRecord(1);
- this.field_5 = a.a(var2);
- var1.closeRecordStore();
- } catch (RecordStoreException var7) {
- System.err.println(var7);
- } finally {
- System.gc();
- }
-
- if (this.field_5.length != ((Canvas)this).getWidth() || this.field_5[0].length != ((Canvas)this).getHeight()) {
- System.err.println(method_6("H\u001ds,\u0010~+d,\u0010\u007fXs1\u0007{\fu'Bu\u00160'\u000b|\u001eu1\u0007t\f0'\u0007l\u0011s&C"));
- this.field_5 = new boolean[((Canvas)this).getWidth()][((Canvas)this).getHeight()];
- System.gc();
- }
-
- }
-
- public void run() {
- // $FF: Couldn't be decompiled
- }
-
- // $FF: renamed from: a (java.lang.String) java.lang.String
- private static String method_6(String var0) {
- char[] var1 = var0.toCharArray();
- int var2 = var1.length;
- int var3 = 0;
- char[] var10000;
- int var10001;
- if (var2 <= 1) {
- var10000 = var1;
- var10001 = var3;
- } else {
- if (var3 >= var2) {
- return new String(var1);
- }
-
- var10000 = var1;
- var10001 = var3;
- }
-
- while(true) {
- char var10002 = var10000[var10001];
- byte var10003;
- switch (var3 % 5) {
- case 0:
- var10003 = 26;
- break;
- case 1:
- var10003 = 120;
- break;
- case 2:
- var10003 = 16;
- break;
- case 3:
- var10003 = 67;
- break;
- default:
- var10003 = 98;
- }
-
- var10000[var10001] = (char)(var10002 ^ var10003);
- ++var3;
- if (var2 == 0) {
- var10000 = var1;
- var10001 = var2;
- } else {
- if (var3 >= var2) {
- return new String(var1);
- }
-
- var10000 = var1;
- var10001 = var3;
- }
- }
- }
- }
-